package com.gt.aep.base.service.systemManage;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gt.aep.base.dao.systemManage.SysPermissionDao;
import com.gt.aep.base.entity.systemManage.SysPermission;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class SysPermissionService extends ServiceImpl<SysPermissionDao,SysPermission>{

    @Autowired
    SysPermissionDao sysPermissionDao;

    /**
     * 新增权限
     * @param sysPermission
     * @return
     */
    public int insert(SysPermission sysPermission){
        return sysPermissionDao.insert1(sysPermission);
    }

    /**
     * 修改权限信息
     * @param sysPermission
     * @return
     */
    public int update(SysPermission sysPermission){
        return sysPermissionDao.update(sysPermission);
    }

    /**
     * 批量删除权限
     * @param ids
     * @return
     */
    public int delete(String[] ids){
        return sysPermissionDao.delete(ids);
    }

    /**
     * 获取全部的权限列表
     * @return
     */
    public List<SysPermission> getList(){
        return sysPermissionDao.getList();
    }


    public List<Map<String, Object>> getPermissionByUserId(String id) {
        return sysPermissionDao.getPermissionByUid(id);
    }
}
